﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AuthorInqury
{
    public partial class Add : Form//子窗体
    {
        public Add()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)//Add页面的添加
        {
            //将文本框中的数据存入SqlData类型的变量udata中
            SqlData udata = new SqlData();
            udata.Author = textBox1.Text;
            udata.title = textBox2.Text;
            udata.datetime = textBox3.Text;

            new SqlData().AuthorInqury(udata);//调用添加数据函数，添加数据udata
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.textBox1.Text.Trim();//获取作者的名字
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            this.textBox2.Text.Trim();//获取作者的标题
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            this.textBox3.Text.Trim();//获取作者的创造时间
        }
    }
        

        }
    }


